<?php

/**
 * 用户认证模型
 *
 * @author sandy
 *
 */
class authorizeModel extends Model {
	
	private $data = array(
				'admin' => array(
							'user_name' => 'admin',
							'nick_name' => '管理员',
							'password' => '1@#321',
						),
			);
	
	public function authorize($user_name,$password) {
		$data = $this->data;
		
		if ( array_key_exists($user_name,$data) && $data[$user_name]['password'] == $password ) {
			return true;
		}
		return false;
	}

	public function get_user_info($user_id){
		
		if ( array_key_exists($user_id,$this->data) ) {
			return $this->data[$user_id];
		}
		
		return false;
	}
}